﻿<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<input type="hidden" id="hprnn" value="${hprnn}"/>
<input type="hidden" id="nPSize" value="${nPSize}"/>
<input type="hidden" id="prv" value="${isprv}"/>
<input type="hidden" id="cif" value="${cif}"/>
<script language="JavaScript" type="text/JavaScript">

$(document).ready(function(){
	/*控制单选按钮的选中*/
	var divIds = new Array('ispf1','ispf2','ispf3','ispf4');
	var isprIds = new Array('ispr1','ispr2','ispr3','ispr4');
	for(var i=0;i<divIds.length;i++){
		if(divIds[i] == $("#prv").attr("value")){
			document.getElementById(isprIds[i]).checked = "true";
		}
	}
	
	
	
	/*控制层的选中*/
    var divIds = new Array('ispf1','ispf2','ispf3','ispf4');
    for(var i=0;i<divIds.length;i++){
	   if(divIds[i] == $("#prv").attr("value")){
	  	 var divb = document.getElementById(divIds[i]);
   		 divb.style.display="block";
	   }else{
	  	 var divn = document.getElementById(divIds[i]);
	  	 divn.style.display="none";
	   }
	 }
	
	
    var hn = document.getElementById("hprnn").value;
    var nps = document.getElementById("nPSize").value;
    var cf = document.getElementById("cif").value;
    if(cf == "buzhengque"){
    	alert("请选择相应的导入格式，请检查好导入内容的格式后再导入！");
    }
    if(hn == "重复"){
    	alert("分区号或分区名有重复，请检查后再导入！");
    }
    if(nps == "nPSize"){
    	var ns=confirm("目前导入的分区数与本渠道已有分区数不相同,是否继续导入？")
    	if (ns==true)
	    {
	    	var myForm = document.getElementById("myForm");
	    	myForm.action = "<%=basePath%>partition_disposalPartitionContent.action?isci=yisci";
			myForm.onsubmit();
	    }
	  	else
	    {
	    	return;
	    }
    	
    }
	});
	
	/*点击单选按钮触发层的显示或隐藏*/
function selectFormat(id){
  
   var divIds = new Array('ispf1','ispf2','ispf3','ispf4');
   for(var i=0;i<divIds.length;i++){
  
	  if(id == i){
	  	var divb = document.getElementById(divIds[i]);
   		divb.style.display="block";
	  }else{
	  	var divn = document.getElementById(divIds[i]);
	  	divn.style.display="none";
	  }
	}
  return;
  }
</script>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
			<!--  
			<li><a title=""  class="edit"
			href="pricemanager/Channel/EditStartPartition.html" target="navTab" rel="EditStartPartition"><span>修改起始分区</span></a></li>
			-->
			<li><a title=""  class="edit"
			href="<%=basePath%>partition_check_E_Partition.action?pChannel_number=${pChannelABean.channel.PChannelNumber}&partitionClass=EN" target="navTab" rel="EndPartitionTable"><span>查看目的分区</span></a></li>
			<li class="line">line</li>
			<li><a class="icon" href="demo/common/dwz-team.xls" target="dwzExport" targetType="navTab" title="是要导出分区表吗?"><span>导出分区表</span></a></li>
			<li><a class="icon" href="demo/common/dwz-team.xls" target="dwzExport" targetType="navTab" title="是要检查分区表吗?"><span>检查分区表</span></a></li>
		</ul>
	</div>
	<br />
	<label class="contentTitle" style="font-size: 14;">说明：分区号、分区名、国家名之间以某种分隔符分隔，分隔符可为&nbsp;，,&nbsp;。\&nbsp;、和空格。</label>
	<div class="divider"></div>
<div class="pageContent">
	<form id="myForm" method="post" action="<%=basePath%>partition_disposalPartitionContent.action?isci=nisci" class="pageForm required-validate" onsubmit="return validateCallback(this,navTabAjaxDone)">
		<input type="hidden" name="partitionClass" value="EN"/>
		<input type="hidden" name="Dizhi" value="pricemanager/Channel/EditImportEndPartition.jsp"/>
		<div>
			<label>&nbsp;&nbsp;渠道名称：</label>
			<input name="pChannel_number" type="hidden" value="${pChannelABean.channel.PChannelNumber}" />
			<input name="pChannelABean.channel.PChannelName" class="required" type="text" size="30" value="${pChannelABean.channel.PChannelName}"  readonly="true"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			<br/><label style="color: red;">&nbsp;&nbsp;请选择导入格式：</label>
			
			<input onclick="selectFormat(0)" name="ispr" id="ispr1" type="radio" value="ispf1" checked="checked">
				目的地&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			<input onclick="selectFormat(1)" name="ispr" id="ispr2" type="radio" value="ispf2">
				分区号、目的地&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			<input onclick="selectFormat(2)" name="ispr" id="ispr3" type="radio" value="ispf3">
				分区名、目的地&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			<input onclick="selectFormat(3)" name="ispr" id="ispr4" type="radio" value="ispf4">
				分区号、分区名、目的地&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		</div>
		<div class="pageFormContent" layoutH="160">
				<div style="display:block; width: 100%">
					<div id="ispf1" style="display: block; background-color: #CCCCCC; font-size: 18;">
						&nbsp;&nbsp;目的地：
					</div>
					<div id="ispf2" style="display: none; background-color: #CCCCCC; font-size: 18;">
						&nbsp;&nbsp;分区号：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;目的地：
					</div>
					<div id="ispf3" style="display: none; background-color: #CCCCCC; font-size: 18;">
						&nbsp;&nbsp;分区名：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;目的地：
					</div>
					<div id="ispf4" style="display: none; background-color: #CCCCCC; font-size: 18;">
						&nbsp;&nbsp;分区号：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;分区名：
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;目的地：
					</div>
					<textarea name="partitionContent" style="width: 100%" class="required" cols="120" rows="15">${partitionContent}</textarea>
				</div>	
		</div>
		<div class="formBar">
			<ul>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">开始导入</button></div></div></li>
				<li>
					<div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div>
				</li>
			</ul>
		</div>
	</form>
</div>
</div>
